/*
Kakine
ActionScript Framework
Copyright © 2011, PUNY, LLC.

This file is part of KAKINE.

KAKINE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

KAKINE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with KAKINE.  If not, see <http://www.gnu.org/licenses/>.
*/ 
package com.puny.utils
{
	internal class WeightedIndex extends Object
	{
		private var _index:uint;
		private var _bottom:uint;
		private var _top:uint;
		public function WeightedIndex(index:uint, from:uint, range:uint)
		{
			this.index = index;
			bottom = from;
			top = bottom + range - 1;
			super();
		}
		
		public function hit(i:uint):Boolean {
			return (_bottom <= i && i <= _top);
		}
		
		public function get index():uint
		{
			return _index;
		}

		public function set index(value:uint):void
		{
			_index = value;
		}

		public function get bottom():uint
		{
			return _bottom;
		}

		public function set bottom(value:uint):void
		{
			_bottom = value;
		}

		public function get top():uint
		{
			return _top;
		}

		public function set top(value:uint):void
		{
			_top = value;
		}


	}
}